#include <iostream>
#include "../includes/need-a-name.hh"
#include "../includes/project-base.hh"
#include "../includes/subproject-base.hh"
#include "../includes/equation-base.hh"
#include "../includes/init-base.hh"
#include "../includes/boundary-base.hh"

#include "../equations/includes/constant-advection.hh"
#include "../equations/includes/sound-wave.hh"
#include "../equations/includes/euler.hh"
#include "../equations/includes/mhd.hh"

#include "includes/project_dg_1D_YASP.hh"

namespace fv3d{
}

//-----------------------------------------
Project_dg_1D_YASP::Project_dg_1D_YASP(){ 
}
Project_dg_1D_YASP::~Project_dg_1D_YASP(){
}
void Project_dg_1D_YASP::set_project_signature(){
  project_signature="dg_1D_YASP";
}
void Project_dg_1D_YASP::set_common_parameters(int subproj){
  // Grid and dimension need to be assigned in driver-file.cc and setting.hh
  // Grid: #define YASP
  // dimension: const int dimension=1
  setting::timeadvance=setting::euler;
  setting::boundary=setting::constant;
  gridsetting::lower[0]=0.0;
  gridsetting::upper[0]=2.0;
  gridsetting::element[0]=200;
  timerule::start=0.0;
  timerule::end=1.0;
  timerule::dt=1.0E-100;
  timerule::current=0.0;
  timerule::counter=0.0;
  timerule::cfl=0.8;
  memory::dgorder=2;
  // equation parameter
  get_subproject(subproj)->equation->set_parameter("u0",1.0);
  // init parameter
  get_subproject(subproj)->init->set_parameter("cen1",0.5);
  get_subproject(subproj)->init->set_parameter("wid1",0.2);
  get_subproject(subproj)->init->set_parameter("rectangle",1.0);
  get_subproject(subproj)->init->set_parameter("circle",0.0);    
  // boundary setting
  for(int tmpp=0; tmpp<memory::phynumber; tmpp++)
    for(int tmpd=0; tmpd<gridsetting::dimension; tmpd++){
      get_subproject(subproj)->boundary->left[tmpp][tmpd]="const";
      get_subproject(subproj)->boundary->left[tmpp][tmpd]="const";      
    }
}

void Project_dg_1D_YASP::load_subprojects(){
  // add_subproject(new conadv::LFTest());
  // add_subproject(new conadv::UpwindTest());
  // add_subproject(new conadv::LWTest());
  // add_subproject(new conadv::rk2TVDLFTest());
  // add_subproject(new conadv::TVDLFTest());
};
